home *** CD-ROM | disk | FTP | other *** search
/ Workbench Add-On / Workbench Add-On - Volume 1.iso / Dev / ACE / utils / pager / pager.b
Text File  |  1994-10-22  |  587b  |  38 lines

  1. '..Prints a document, throwing paper to the top-of-form
  2. '..each time "- page" is encountered. The latter is
  3. '..produced by autonum.b and found in ace.doc.
  4.  
  5. input "Print which file";x$
  6. input "Name of print device [PRT:]";dev$
  7.  
  8. if dev$="" then dev$="PRT:"
  9.  
  10. open "I",1,x$
  11.  
  12. if ERR then 
  13.    print"Can't open file!"
  14.    stop
  15. end if
  16.  
  17. open "O",2,dev$
  18.  
  19. if ERR then 
  20.    print"Can't open printer device!"
  21.    stop
  22. end if
  23.  
  24. ON BREAK goto quit
  25. BREAK ON
  26.  
  27. while not eof(1)
  28.  line input #1,ln$
  29.  print #2,ln$
  30.  '..form feed?
  31.  if instr(ln$,"- page") then 
  32.     print #2,chr$(12)  
  33.  end if
  34. wend
  35.  
  36. quit:
  37. close 1,2
  38.